package com.file;

import java.io.File;

public class FileDemo {
    public static void main(String[] args) {
        /**
         * 相对路径
         */
        File file = new File("./demo.txt");
        String name = file.getName();
        System.out.println("文件的名字" + name);

        long length = file.length();
        System.out.println("文件的字节" + length);

        boolean b = file.canRead();
        System.out.println("文件是否可读= " + b);

        boolean b1 = file.canWrite();
        System.out.println("文件是否可写= " + b1);

        boolean hidden = file.isHidden();
        System.out.println("文件隐藏" + hidden);
    }
}
